<?php

namespace common\model;

use think\model\RelationModel;

class ProjectStepCategoryConfirmConfigModel extends RelationModel
{
    const TYPE_DELAY = 'delay';
    const TYPE_TASK_WORK_ORDER = 'task_work_order';
    const TYPE_DEMAND_ORDER_CONFIRM = 'demand_order_confirm';

    //自动验证
    protected $_validate = [

        ['project_id', '', '', self::MUST_VALIDATE, 'require'],
        ['step_category_id', '', '', self::MUST_VALIDATE, 'require'],
        ['confirm_user_id ', '', '', self::MUST_VALIDATE, 'require'],

        ['project_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['step_category_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['confirm_user_id', '', '', self::EXISTS_VALIDATE, 'integer'],
        ['type', [self::TYPE_DELAY, self::TYPE_TASK_WORK_ORDER, self::TYPE_DEMAND_ORDER_CONFIRM], '', self::EXISTS_VALIDATE, 'in'], // 类型


    ];

    //自动完成
    protected $_auto = [
        ['created_by', 'fill_created_by', self::MODEL_INSERT, 'function'],
        ['created', 'time', self::MODEL_INSERT, 'function'],
    ];

}
